package cn.tedu.charging.order.dao.repository.impl;

import cn.tedu.charging.order.dao.mapper.ChargingFailMapper;
import cn.tedu.charging.order.dao.mapper.ChargingSuccessMapper;
import cn.tedu.charging.order.dao.repository.ChargingBillRepository;
import cn.tedu.charging.order.pojo.po.ChargingFailPO;
import cn.tedu.charging.order.pojo.po.ChargingSuccessPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class ChargingBilRepositoryImpl implements ChargingBillRepository {
    @Autowired
    ChargingSuccessMapper chargingSuccessMapper;
    @Autowired
    ChargingFailMapper chargingFailMapper;

    @Override
    public Integer saveSuccessOrder(ChargingSuccessPO chargingSuccessPO) {
        //成功就使用成功的Mapper
        return chargingSuccessMapper.insert(chargingSuccessPO);
    }

    @Override
    public Integer saveFailOrder(ChargingFailPO chargingFailPO) {
        //失败就使用失败的Mapper
        return chargingFailMapper.insert(chargingFailPO);
    }
}
